#使用一个基础的Python镜像作为基础
FROM registry.cn-shanghai.aliyuncs.com/jokerak/conda

WORKDIR /app

EXPOSE 5000
WORKDIR /app
#将发布文件复制到容器目录
COPY . /app
# 配置conda镜像源
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
RUN conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
RUN conda config --set show_channel_urls yes
# 设置huggingface镜像
RUN export HF_ENDPOINT=https://hf-mirror.com

# 提前把模型下载下来
RUN python chat_utils.py
# 安装依赖
RUN pip install -r requirements_extend.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

ENTRYPOINT ["python", "main.py"]
